package com.hhxyjsj.singleton;

/**
 * 计算器
 * @author Puhui
 *
 */
public class Calculator {
	
	private Calculator(){
	}
	
	public static Calculator getInance(){
		return CalculatorHandler.CALCULATOR;
	}
	
	final static class CalculatorHandler{
		public final static Calculator CALCULATOR = new Calculator();
	}
	
	/**
	 * 加法
	 * 
	 * @param x
	 * @param y
	 * @return
	 */
	public long add(long x, long y){
		return x + y;
	}
	
	/**
	 * 减法
	 * 
	 * @param x
	 * @param y
	 * @return
	 */
	public long subt(long x, long y){
		return x - y;
	}
	
	/**
	 * 乘法
	 * 
	 * @param x
	 * @param y
	 * @return
	 */
	public long mult(long x, long y){
		return x * y;
	}
	
	/**
	 * 除法
	 * 
	 * @param x
	 * @param y
	 * @return
	 */
	public long div(long x, long y){
		return x / y;
	}
}
